﻿using System;
using System.Diagnostics;

namespace Codemonk.Common.Logging
{
    public sealed class DiagnosticLog : Log
    {
        public override void Record(LogLevel level, object message)
        {
            Debug.WriteLine("{0:yyyy/MM/dd HH:mm:ss}-{1,6}-{2}", DateTime.Now, level, message);
        }

        public override void Record(LogLevel level, object message, Exception exception)
        {
            Debug.WriteLine("{0:yyyy/MM/dd HH:mm:ss}-{1,6}-{2}-{3}", DateTime.Now, level, message, exception);
        }

        public override void Record(LogLevel level, object message, string format)
        {
            Debug.WriteLine("{0:yyyy/MM/dd HH:mm:ss}-{1,6}-{2}", DateTime.Now, level, string.Format(format, message));
        }

        public override void Record(LogLevel level, object message, string format, IFormatProvider provider)
        {
            if (provider == null)
                Debug.WriteLine("{0:yyyy/MM/dd HH:mm:ss}-{1,6}-{2}", DateTime.Now, level, string.Format(format, message));
            else
                Debug.WriteLine("{0:yyyy/MM/dd HH:mm:ss}-{1,6}-{2}", DateTime.Now, level, string.Format(format, provider, message));
        }
    }

}
